<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>用户列表</caption>
  <tr>
    <th>用户名</th>
    <th>密码</th>
    <th>昵称</th>
  </tr>

</table>
<script>
  ////将多个信息封装到一个数组对象中
  let arr = [{name:"张三",password:111,nickname:"小三"},
    {name:"李四",password:222,nickname:"小四"},
    {name:"王五",password:333,nickname:"小五"},
    {name:"赵六",password:444,nickname:"小六"}]
  let table = document.querySelector("table");
  for (let user of arr) {
    let tr = document.createElement("tr");
    let nameTd = document.createElement("td");
    let passwordTd = document.createElement("td");
    let nicknameTd = document.createElement("td");
    //设置显示内容
    nameTd.innerText = user.name;
    passwordTd.innerText = user.password;
    nicknameTd.innerText = user.nickname;
    tr.append(nameTd,passwordTd,nicknameTd);
    table.append(tr);

  }


</script>

</body>
</html>